package c.c.b.a.b;

import c.c.b.a.b.a.e;
import java.security.cert.Certificate;
import java.util.Collections;
import java.util.List;
import javax.net.ssl.SSLPeerUnverifiedException;
import javax.net.ssl.SSLSession;

/* compiled from: Handshake */
public final class u {
    public final g a;
    public final l b;
    public final List<Certificate> c;
    public final List<Certificate> d;

    public u(g gVar, l lVar, List<Certificate> list, List<Certificate> list2) {
        this.a = gVar;
        this.b = lVar;
        this.c = list;
        this.d = list2;
    }

    public static u a(SSLSession sSLSession) {
        String cipherSuite = sSLSession.getCipherSuite();
        if (cipherSuite != null) {
            l a = l.a(cipherSuite);
            String protocol = sSLSession.getProtocol();
            if (protocol != null) {
                Object[] peerCertificates;
                List l;
                List l2;
                g a2 = g.a(protocol);
                try {
                    peerCertificates = sSLSession.getPeerCertificates();
                } catch (SSLPeerUnverifiedException unused) {
                    peerCertificates = null;
                }
                if (peerCertificates != null) {
                    l = e.l(peerCertificates);
                } else {
                    l = Collections.emptyList();
                }
                Certificate[] localCertificates = sSLSession.getLocalCertificates();
                if (localCertificates != null) {
                    l2 = e.l(localCertificates);
                } else {
                    l2 = Collections.emptyList();
                }
                return new u(a2, a, l, l2);
            }
            throw new IllegalStateException("tlsVersion == null");
        }
        throw new IllegalStateException("cipherSuite == null");
    }

    public boolean equals(Object obj) {
        boolean z = false;
        if (!(obj instanceof u)) {
            return false;
        }
        u uVar = (u) obj;
        if (this.a.equals(uVar.a) && this.b.equals(uVar.b) && this.c.equals(uVar.c) && this.d.equals(uVar.d)) {
            z = true;
        }
        return z;
    }

    public int hashCode() {
        return this.d.hashCode() + ((this.c.hashCode() + ((this.b.hashCode() + ((this.a.hashCode() + 527) * 31)) * 31)) * 31);
    }
}
